package com.tensquare.base.controller;

import entity.Result;
import entity.StatusCode;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * 描述：基础的异常处理类
 *
 * @author wangb
 * @version create 2019-08-15-18:14
 */
@RestControllerAdvice
public class BaseExceptionHandler{
    @ExceptionHandler(value = Exception.class)
    public Result exception(Exception e) {
        e.printStackTrace ();
        return new Result (false, StatusCode.ERROR,e.getMessage ());
    }
}
